package com.tsd.base.dao;

import com.tsd.base.entity.BaseCodeRule;
import com.tsd.base.entity.BaseCodeRuleExt;
import com.tsd.core.vo.PageBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：BaseCodeRuleMapper
 *
 * @author zsy
 * @date 2020/12/29 15:22:59
 */
public interface BaseCodeRuleMapper {

    BaseCodeRule selectByPrimaryKey(Long id);

    BaseCodeRuleExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(BaseCodeRule record);

    int insertSelective(BaseCodeRule record);

    int updateByPrimaryKey(BaseCodeRule record);

    int updateByPrimaryKeySelective(BaseCodeRule record);

    List<BaseCodeRuleExt> selectByEntity(BaseCodeRule record);

    List<BaseCodeRuleExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<BaseCodeRuleExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<BaseCodeRuleExt> selectByParams(@Param("params") Map<String, Object> params);

    /**
     * 获取编码规则根据CODE
     *
     * @param code
     * @return
     */
    BaseCodeRuleExt getByCode(String code);

    Integer selectMaxSn();

    int countValid();
}
